package com.douwong.student.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.douwong.student.factory.BaseFragmentFactory;

/**
 * @autor yichao
 * @time 2017/3/2216:10
 * @des ${TODO}
 */
public class MainPagerAdapter extends FragmentPagerAdapter {
    private static final String[] CONTENT = new String[] { "主页", "课堂", "应用", "在线学习" };


    public MainPagerAdapter(FragmentManager fm) {
        super(fm);
    }

    @Override
    public Fragment getItem(int position) {
        return BaseFragmentFactory.getBaseFragment(position);
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return CONTENT[position % CONTENT.length].toUpperCase();
    }
    @Override
    public int getCount() {
        return CONTENT.length;
    }
}
